package gui.tools;

import gui.ColorChooser;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JComponent;

import tools.BucketFillTool;

public class BucketFillSetup extends JComponent{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private ColorChooser seletorCor = new ColorChooser();

	private BucketFillTool tool;
	
	public BucketFillSetup(BucketFillTool tool){
		this.tool = tool;
		
		init();
	}
	
	protected void init(){
	setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
		
		//Seletor cor
		seletorCor.addActionListener(new ActionListener() {
			
			public void actionPerformed(ActionEvent e) {
				tool.setColor(seletorCor.getSelectedColor());
			}
		});
		
		seletorCor.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 20));
		
		add(seletorCor);
		
	}
	
}
